/* 枚举类 */

/**
 * 返回状态码枚举类
 */
export enum ResponseCodeEnum {
  SUCCESS = 0,
  PARAMS_ERROR = 40000,
  NOT_LOGIN_ERROR = 40100,
  NO_AUTH_ERROR = 40101,
  NOT_FOUND_ERROR = 40400,
  FORBIDDEN_ERROR = 40300,
  SYSTEM_ERROR = 50000,
  OPERATION_ERROR = 50001
};

export const ResponseCodeEnumMap = {
  SUCCESS: 'ok',
  PARAMS_ERROR: '请求参数错误',
  NOT_LOGIN_ERROR: '未登录',
  NO_AUTH_ERROR: '无权限',
  NOT_FOUND_ERROR: '请求数据不存在',
  FORBIDDEN_ERROR: '禁止访问',
  SYSTEM_ERROR: '系统内部异常',
  OPERATION_ERROR: '操作失败',
}

/**
 * 用户角色枚举类, 含权限 (后端传来的是编码, 这里要做转换)
 */
export enum UserRoleEnum {
  NOT_LOGIN = -1,
  USER = 0,
  ADMIN = 1,
  BAN = 2
};

export const UserRoleEnumMap = {
  NOT_LOGIN: '未登录',
  USER: '普通用户',
  ADMIN: '管理员',
  BAN: '被封禁',
};

/**
 * SQL 语句排序枚举类
 */
export enum SqlSortOrderEnum {
  ASC = 0,
  DESC = 1
};

export const SqlSortOrderEnumMap = {
  ASC: '升序',
  DESC: '降序',
};

/**
 * 可用于排序的字段枚举类
 */
export enum ValidSortFieldEnum {
  id = 'id',
  createTime = 'createTime',
  updateTime = 'updateTime',
};

export const ValidSortFieldEnumMap = {
  id: 'id',
  createTime: '创建时间',
  updateTime: '最近更新时间',
};

/**
 * 应用类型枚举类
 */
export enum AppTypeEnum {
  SCORE = 0,
  QUESTION = 1
};

export const AppTypeEnumMap = {
  SCORE: '得分类应用',
  QUESTION: '测评类应用'
};

/**
 * 审核状态枚举类
 */
export enum ReviewStatusEnum {
  REVIEWING = 0,
  PASSED = 1,
  REJECTED = 2
};

export const ReviewStatusEnumMap = {
  REVIEWING: '审核中',
  PASSED: '已过审',
  REJECTED: '已拒绝'
};

/**
 * 评分策略枚举类
 */
export enum ScoringStrategyEnum {
  CUSTOMIZED = 0,
  AI = 1
};

export const ScoringStrategyEnumMap = {
  CUSTOMIZED: '自定义评分',
  AI: 'AI 评分'
};

/**
 * 文件上传类型
 */
export enum FileUploadTypeEnum {
  USER_AVATAR = 0,
  APP_ICON = 1,
  SCORING_RESULT_PICTURE = 2
};